<?php
/**
 * @link https://www.kancloud.cn/cleverstone/ymb2
 * @copyright Copyright (c) 2020 Yii Manager Software LLC
 */

/* ====== 选项卡构建器 ====== */
/** @var \yii\web\View $this */
/** @var \builder\tab\TabBuilder $context */
/** @var string $theme 主题风格 */
/** @var array $tabItem 项配置 */
/** @var array $rootLayout 根布局 */

$context = $this->context;
?>
<?php if (!empty($tabItem)): ?>
<div id="__YM2_BUILDER_ID__<?= $context->id ?>" class="pl-3 pr-4 <?= $rootLayout['class'] ?>" ng-controller="ym2.ctrl.<?= $context->id ?>" style="<?= $rootLayout['style'] ?>"<?= $rootLayout['attribute'] ?>>
    <!--页面开始-->
    <?= $context->beginPage() ?>

    <!--选项卡部分-->
    <div class="layui-tabs <?= $theme ?>" id="ym2_builder_<?= $context->id ?>">
        <ul class="layui-tabs-header">
<?php foreach ($tabItem['tabLabel'] as $item): ?>
            <li class="<?= $item['selected'] ?>" lay-id="<?= $item['id'] ?>">
                <a href="#<?= $item['id'] ?>"><?= $item['label'] ?></a>
            </li>
<?php endforeach; ?>
        </ul>
        <div class="layui-tabs-body">
<?php foreach ($tabItem['tabContent'] as $item): ?>
            <div class="layui-tabs-item <?= $item['selected'] ?>">
                <?= $item['content'] ?>
            </div>
<?php endforeach; ?>
        </div>
    </div>

    <!--页面结束-->
    <?= $context->endPage() ?>
</div>
<?php endif; ?>
